package com.fan.play.ui.adapter

import com.fan.play.databinding.LayoutCaptureItemBinding

class CaptureAdapter : BaseBindingAdapter<String, LayoutCaptureItemBinding>() {

    override fun convert(holder: BaseBindingHolder<LayoutCaptureItemBinding>, item: String) {
        holder.binding.btnCapture.text = item

        holder.binding.btnCapture.setOnClickListener {
            holder.binding.btnCapture.isActivated = !holder.binding.btnCapture.isActivated
            holder.itemView.isActivated = holder.binding.btnCapture.isActivated
            getOnItemClickListener()?.onItemClick(this, holder.itemView, holder.layoutPosition)
        }
    }
}